package com.cy.account.controller;

import com.cy.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/decrease") // localhost:8081/decrease?userId=1&money=100
    public String decrease(Long userId, BigDecimal money){
        accountService.decrease(userId,money);
        return "用户扣减金额成功";
    }
}
